#ifndef _QUADRDEFS_H
#define _QUADRDEFS_H

/* insert common declarations/definitions shared between quadrd and quadrc */

#include "fns.h"

#define BUFSIZE 512

#define MAXSZ 4096

typedef struct Params{
				char *fnName;
				double lo_bound;
				double hi_bound;
				int n_intervals;
				int error;
}Params;

union semun {
				int              val;    /* Value for SETVAL */
				struct semid_ds *buf;    /* Buffer for IPC_STAT, IPC_SET */
				unsigned short  *array;  /* Array for GETALL, SETALL */
				struct seminfo  *__buf;  /* Buffer for IPC_INFO
																		(Linux specific) */
};

/* Funtion for calulating integral by using trapezoidal rule */
//double trapezoidal (FnP fnPtr, double lo_bound, double hi_bound, int n_intervals);

/* To find the integration accurately split the intervals of the integration into n intervals and find out summation of it.
	 And then apply trapeziodal rule on it */
//double calc_sum (FnP fnPtr, double lo_bound, double hi_bound, int n_intervals);

/* This will check if the given function is available*/
int isFunAvailable (char *strPtr);
/* Pass 0/1 as 2nd argument to checkNum funtion to check if it is double or not */
int checkNum (char *strPtr, int isDouble);

//void createProcessTree(int *childProcesses, int childIndex, int level, int debug);

//void getData (int **parentInFD, int **parentRtFD, int children, int level, int debug);
//void integration (int children, int level, int debug);

#endif /* ifndef _QUADRDEFS_H */
